package org.dtrd.modules.patient.entity.bean.report;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Map;

/**
 * @author : qiannai
 * @date: 2022/8/23 17:55
 * @describe : 月报的输入数据请求接口
 */
@ApiModel("月报更新的请求数据接口")
@Getter
@Setter
public class ReportMonthUpdateRequest {

    @ApiModelProperty(value = "报告id", required = true)
    @NotNull
    private Integer reportId;

    @ApiModelProperty(value = "本月的体型照片", required = true)
    private String bodyPictures;

    @ApiModelProperty(value = "前端上传的报告单图片路径，多张图片使用,进行分割")
    private String reportPictures;

    @ApiModelProperty(value = "发布状态")
    @NotNull
    private Integer publishStatus;

    @ApiModelProperty(value = "总结", required = true)
    @NotBlank
    private String summary;

    @ApiModelProperty("实验室检查输入数据")
    private Map<Integer, Float> laboratoryList;


    @ApiModel("数据库保存前端输入的Json类")
    @Getter
    @Setter
    public static class ReportMonthInputUpdate{

        @ApiModelProperty(value = "本月的体型照片", required = true)
        private String bodyPictures;

        @ApiModelProperty(value = "前端上传的报告单图片路径，多张图片使用,进行分割")
        private String reportPictures;

        /**
         * 将数据转化为Json进行保存
         * @return
         */
        public ReportMonthUpdateRequest.ReportMonthInputUpdate makeJson(ReportMonthUpdateRequest po) {
            ReportMonthUpdateRequest.ReportMonthInputUpdate reportMonthInputUpdate = new ReportMonthUpdateRequest.ReportMonthInputUpdate();
            reportMonthInputUpdate.setReportPictures(po.reportPictures);
            reportMonthInputUpdate.setBodyPictures(po.bodyPictures);
            return reportMonthInputUpdate;
        }
    }
}
